<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="YYK-title-10003" /></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=0.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name=”apple-mobile-web-app-capable” content=”yes” />
	<script type="text/javascript">
	;(function (doc, win) {
	    var docEl = doc.documentElement,
	      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
	      recalc = function () {
	        var clientWidth = docEl.clientWidth;
	        var clientHeight = docEl.clientHeight;
	        if (!clientWidth) return;
	        if (clientWidth < clientHeight) {
	            docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
	        }else{
	          docEl.style.fontSize = 50 * (clientWidth / 1136) + 'px';
	        }
	      };
	      recalc();
	    if (!doc.addEventListener) return;
	    win.addEventListener(resizeEvt, recalc, false);
	    doc.addEventListener('DOMContentLoaded', recalc, false);   
	})(document, window);
	</script>
	
	<link rel="stylesheet" href="${static_server}/static/css/default.css">
	<link rel="stylesheet" href="${server}/static/css/iconfont/iconfont.css">
	<link rel="stylesheet" href="${static_server}/static/css/common/zepto.alert.css">
	<script type="text/javascript" src="${static_server}/static/js/zepto.min.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/iscroll.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/index.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/zepto.alert.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/common.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/common/common.ajax.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/cart/cart.js"></script>
	<%-- <script type="text/javascript" src="${static_server}/static/js/index.js"></script> --%>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/weixin/wx.js"></script>
	
	<script type="text/javascript">
	$(document).ready(function(){
		
		 // 苹果手机采用CSS1
		  if(/iphone/i.test(navigator.userAgent)){
		      $(".contentWrap").addClass("mt1s8");
		  }
		  // 安卓手机采用CSS2
		  if(/android/i.test(navigator.userAgent)){
		    $(".contentWrap").css("padding-top","0.89rem");
		  }
		
		var myScroll = new IScroll('#wrapper', {  
	        probeType: 2,//probeType：1对性能没有影响。在滚动事件被触发时，滚动轴是不是忙着做它的东西。probeType：2总执行滚动，除了势头，反弹过程中的事件。这类似于原生的onscroll事件。probeType：3发出的滚动事件与到的像素精度。注意，滚动被迫requestAnimationFrame（即：useTransition：假）。  
	        scrollbars: false,//有滚动条  
	        mouseWheel: true,//允许滑轮滚动  
	        fadeScrollbars: false,//滚动时显示滚动条，默认影藏，并且是淡出淡入效果  
	        bounce:true,//边界反弹  
	        interactiveScrollbars:true,//滚动条可以拖动  
	        shrinkScrollbars:'scale',// 当滚动边界之外的滚动条是由少量的收缩。'clip' or 'scale'.  
	        click: true ,// 允许点击事件  
	        keyBindings:true,//允许使用按键控制  
	        momentum:true// 允许有惯性滑动  
	    }); 
	});
	function goBack(){
		var path = $('#path').val();
		var shopId = $('#shopId').val();
		window.location.href=path+"/shop/find/"+shopId;
	}
	
	</script>

</head>
<body>
<div class="popDiv">
	<%-- <div class="popBg"></div>
	<div class="popBox">
		<div class="selectSalesComponent">
			<div class="selectSalesHead">请选择为您结算的导购</div>
			<div class="selectSalesBody">
				<ul>
				</ul>
			</div>
		</div>
	</div> --%>
</div>
<div id="cart-box">
	<div class="wrap" id="cart-list">
		<header class="headerToFixed">
			<div class="closeBtn" onclick="javascript:goBack();">
			   <i class="icon iconfont">&#xe60a;</i>
			</div>
			<div class="headerTitle">
				${cartDTO.shop.shopNameCn}
			</div>
			<!-- <div class="nextBtn fr">下一箱&nbsp;<i class="icon iconfont">&#xe604;</i></div>
			<div class="preBtn fr">上一箱&nbsp;<i class="icon iconfont">&#xe605;</i></div>
			-->
			<div class="refresh" onclick="javascript:reloadCart();">
			   <i class="icon"></i>
			</div>
		</header> 
		<div class="contentWrap">
			
			<%-- <div class="srcollBox"> --%>
				<div id="wrapper"
					style="top: 0.9rem;
				<c:if test="${not empty cartDTO and not empty cartDTO.cartSkuDTOList}">bottom:3rem;</c:if>">
					<div id="scroller">
						<%-- <div id="pullDown">
						<span class="pullDownIcon"></span>
						<span class="pullDownLabel"></span>
						</div> --%>
						<div class="sweepComponent">
							<div class="J_sweepBtn" onclick="javascript:scanMerchandise();">
								<i class="icon iconfont">&#xe607;</i>
								<p class="pText">扫一扫</p>
							</div>

							<div class="sweepText">
								<%--<c:if test="${not empty cartDTO.shopPromotionList}">
								 <c:forEach items="${cartDTO.shopPromotionList}" var="shopPromotion">
									<p>
										<span>满€<fmt:formatNumber value="${shopPromotion.orderPrice}" type="currency" pattern="#0"/></span>
										<span><fmt:formatNumber value="${shopPromotion.discount*10}" type="currency" pattern="#0"/>折</span>
										<c:if test="${not empty shopPromotion.couponType}">
											<span>
												送<fmt:formatNumber value="${shopPromotion.couponPrice}" type="currency" pattern="#0"/>€
												<c:choose>
													<c:when test="${shopPromotion.couponType eq 0}">现金券</c:when>
													<c:when test="${shopPromotion.couponType eq 1}">其他券</c:when> 
												</c:choose>
											</span>
										</c:if>
									</p>
								</c:forEach> 	</c:if> --%>
								<p>
									<span>满€<fmt:formatNumber value="88" type="currency"
											pattern="#0" /></span> <span> <spring:message
											code="YYK-20051" />
									</span>
								</p>
							</div>

						</div>

						<c:if test="${not empty cartDTO.cartSkuDTOList}">
							<ul class="productList">
								<c:forEach items="${cartDTO.cartSkuDTOList}" var="cartSkuDTO">
									<li data-value="lancome item" class="spec"
										id="${cartSkuDTO.merchandise.merchandiseNumber}_${cartSkuDTO.qty}_${cartSkuDTO.merchandise.merchandiseBarcode}">
										<div class="pImgS"
											onclick="window.location.href='${server}/merchandise/${cartSkuDTO.merchandise.merchandiseNumber}.html'">
											<img
												src="${static_server}${cartSkuDTO.merchandise.merchandiseIcon}">
										</div>
										<div class="pDetail">
											<p class="pTitle"
												onclick="window.location.href='${server}/merchandise/${cartSkuDTO.merchandise.merchandiseNumber}.html'">
												${cartSkuDTO.merchandise.merchandiseNameCn}</p>
											<div class="pOperation">

												<div class="addToShopCart">
													<span class="J_subtract"><i class="icon iconfont">&#xe602;</i></span>
													<span class="J_num">${cartSkuDTO.qty}</span> <span
														class="J_add"><i class="icon iconfont">&#xe601;</i></span>
												</div>
												<div class="J_singleTotalA">
													
													<span class="countSingleA redFont"> €<fmt:formatNumber
															value="${cartSkuDTO.merchandise.merchandisePrice}" pattern="#0.00" />
													</span>
												</div>
												<span class="deleteBtn fr"> <span class="J_deleteBtn"><i
														class="icon iconfont">&#xe600;</i></span>
												</span>
											</div>
										</div>
									</li>
								</c:forEach>
							</ul>
						</c:if>
						<c:if test="${empty cartDTO.cartSkuDTOList}">
							<jsp:include page="./cartEmpty.jsp" />
						</c:if>
						<!-- <div id="pullUp">
						<span class="pullUpIcon"></span>
						<span class="pullUpLabel"></span>
					</div> -->

					</div>
				</div>
				<%-- </div> --%>
		</div>
		<c:if test="${not empty cartDTO.cartSkuDTOList}">
		<footer style="position: fixed;bottom: 0;left: 0;height: 3.0rem;">
				<div class="totalAcountBox mts14">
						<p>
							<%-- <label class="dutyFreePrice"><spring:message code="YYK-20009" />：<span class="redFont">
							<fmt:formatNumber value="${cartDTO.payAmount - cartDTO.totalFreight}" pattern="€0.00#" /></span></label>
							<label class="totalAcount"><spring:message code="YYK-20006" />：<del id="J_AllAcount" >
							<fmt:formatNumber value="${cartDTO.itemAmount}" pattern="€0.00#" /></del></label> --%>
							<label class="dutyFreePrice"><spring:message code="YYK-20006" />：<span class="redFont">
							<fmt:formatNumber value="${cartDTO.itemAmount}" pattern="€0.00#" /></span></label> 
						</p>
						<p >
							<label class="saveCompare redFont"><spring:message code="YYK-20007" />: <span>
								<fmt:formatNumber value="${cartDTO.saveAmount}" pattern="￥0.00#" />
							</span></label>
							<label class="carriage"><spring:message code="YYK-20008" />：<span>
							<c:if test="${cartDTO.totalFreight==0}">
								<spring:message code="YYK-20055" />
							</c:if>
							<c:if test="${cartDTO.totalFreight!=0}">
								<fmt:formatNumber value="${cartDTO.totalFreight}" pattern="€0.00#" />
							</c:if>
							</span></label> 
						</p>
					</div>
				<div id="settlement-btn" onclick="javascript:settlement();" class="saveBtn">
					<spring:message code="YYK-20010" />(${cartDTO.totalNumber})
					<span id="allProQuan" ></span>
				</div>
		</footer>
		</c:if>
	</div>
</div>
<input type="hidden" id="wx-appId" value="${appId}"/>
<input type="hidden" id="wx-timestamp" value="${timestamp}"/>
<input type="hidden" id="wx-nonceStr" value="${nonceStr}"/>
<input type="hidden" id="wx-signature" value="${signature}"/>

<input type="hidden" id="path" value="${server}"/>
<input type="hidden" id="shopId" value="${cartDTO.shop.shopId}"/>

</body>
</html>	